<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">PDFGAUSS</b>
<td valign="baseline" align="right" class="function"><a href="../probab/index.html" target="mdsdir"><img border = 0 src="../up.gif"></a></table>
  <p><b>Evaluates multivariate Gaussian distribution.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;=&nbsp;pdfgauss(X,&nbsp;Mean,&nbsp;Cov)</span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;=&nbsp;pdfgauss(X,&nbsp;model&nbsp;)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;=&nbsp;pdfgauss(X,&nbsp;Mean,&nbsp;Cov)&nbsp;evaluates&nbsp;a&nbsp;multi-variate&nbsp;Gaussian&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;probability&nbsp;density&nbsp;function(s)&nbsp;for&nbsp;given&nbsp;input&nbsp;column&nbsp;vectors&nbsp;in&nbsp;X.</span><br>
<span class=help>&nbsp;&nbsp;Mean&nbsp;[dim&nbsp;x&nbsp;ncomp]&nbsp;and&nbsp;Cov&nbsp;[dim&nbsp;x&nbsp;dim&nbsp;x&nbsp;ncomp]&nbsp;describe&nbsp;a&nbsp;set&nbsp;of&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;ncomp&nbsp;Gaussian&nbsp;distributions&nbsp;to&nbsp;be&nbsp;evaluted&nbsp;such&nbsp;that</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;y(i,j)&nbsp;=&nbsp;exp(-0.5(mahalan(X(:,j),Mean(:,i),Cov(:,:,i)&nbsp;)))/norm_const</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;where&nbsp;i=1:ncomp&nbsp;and&nbsp;j=1:size(X,2).&nbsp;If&nbsp;the&nbsp;Gaussians&nbsp;are</span><br>
<span class=help>&nbsp;&nbsp;uni-variate&nbsp;then&nbsp;the&nbsp;covariaves&nbsp;can&nbsp;be&nbsp;given&nbsp;as&nbsp;a&nbsp;vector</span><br>
<span class=help>&nbsp;&nbsp;Cov&nbsp;=&nbsp;[Cov_1,&nbsp;Cov_2,&nbsp;...,&nbsp;Cov_comp].</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;=&nbsp;pdfgauss(&nbsp;X,&nbsp;model&nbsp;)&nbsp;takes&nbsp;Gaussian&nbsp;parameters&nbsp;from&nbsp;structure</span><br>
<span class=help>&nbsp;&nbsp;fields&nbsp;model.Mean&nbsp;and&nbsp;model.Cov.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Input&nbsp;matrix&nbsp;of&nbsp;column&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;Mean&nbsp;[dim&nbsp;x&nbsp;ncomp]&nbsp;Means&nbsp;of&nbsp;Gaussians.</span><br>
<span class=help>&nbsp;&nbsp;Cov&nbsp;[dim&nbsp;x&nbsp;dim&nbsp;x&nbsp;ncomp]&nbsp;Covarince&nbsp;matrices.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;[ncomp&nbsp;x&nbsp;num_data]&nbsp;Values&nbsp;of&nbsp;probability&nbsp;density&nbsp;function.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;</span><br>
<span class=help>&nbsp;Univariate&nbsp;case</span><br>
<span class=help>&nbsp;&nbsp;x&nbsp;=&nbsp;linspace(-5,5,100);</span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;=&nbsp;pdfgauss(x,0,1);</span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;plot(x,y)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;Multivariate&nbsp;case</span><br>
<span class=help>&nbsp;&nbsp;[Ax,Ay]&nbsp;=&nbsp;meshgrid(linspace(-5,5,100),&nbsp;linspace(-5,5,100));</span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;=&nbsp;pdfgauss([Ax(:)';Ay(:)'],[0;0],[1&nbsp;0.5;&nbsp;0.5&nbsp;1]);</span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;surf(&nbsp;Ax,&nbsp;Ay,&nbsp;reshape(y,100,100));&nbsp;shading&nbsp;interp;</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../probab/gsamp.html" target="mdsbody">GSAMP</a>,&nbsp;<a href = "../probab/pdfgmm.html" target="mdsbody">PDFGMM</a>.</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../probab/list/pdfgauss.html">pdfgauss.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 28-apr-2004, VF<br>

</body>
</html>
